/*
 * Copyright (c) 2016, FPX and/or its affiliates. All rights reserved.
 * Use, Copy is subject to authorized license.
 */
package com.fpx.open.platform.domain.ae.multistage.linehual;

import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;

import org.hibernate.validator.constraints.NotEmpty;

import com.fpx.open.platform.domain.ae.multistage.ExtendedPerson;
import com.fpx.open.platform.domain.ae.multistage.Person;

/**
 * 
 * @author shiw
 * @date 2016年8月3日
 */
@XmlRootElement(name = "request")
public class ReceiveOrderInfoNotify {
	
	/** 物流单号 */
	@NotEmpty
	private String logisticsOrderCode;
	
	/** 发件人信息 */
	private Sender sender;
	
	/** 买家 */
	private ExtendedPerson buyer;
	
	/** 收件人信息 */
	private Receiver receiver;
	
	/** 揽件地址信息 */
	private Person pickup;
	
	/** 包裹信息 */
	private Parcel parcel;
	
	/** 退件信息 */
	private ReturnParcel returnParcel;
	
	/**
	 * 1.4PL线上发货 AE_4PL_ONLINE
	 * 2.无忧物流标准 AE_4PL_STANDARD
	 * 3.无忧物流优先 AE_4PL_PREMIUM
	 */
	private String bizType;
	
	/** 路由次数；缺省：1 */
	private Integer routingTrial;
	
	/** 前一 CP 的资源 Code */
	private String preCPResCode;
	
	/** 后一 CP 的资源 Code */
	private String nextCPResCode;
	
	/** 预约揽收时间 */
	private String pickupTime;
	
	/** 备注 */
	private String remark;
	
	/** 物流面单号 */
	@NotEmpty
	private String trackingNumber;
	
	/** 电子面单 URL */
	private String waybillUrl;
	
	/** 运输工具代码 */
	private String transportCode;
	
	/** 承运商编号 */
	private String carrierCode;
	
	/** 交易结构体 */
	private Trade trade;

	/**
	 * 是否再次路由
	 * @return
	 */
	@XmlTransient
	public boolean isAgainRoute(){
		boolean againRoute = false;
		if(this.routingTrial != null && routingTrial.intValue() > 1){
			againRoute = true;
		}
		return againRoute;
	}
	
	/**
	 * @return the sender
	 */
	public Sender getSender() {
		return sender;
	}

	/**
	 * @param sender the sender to set
	 */
	public void setSender(Sender sender) {
		this.sender = sender;
	}

	/**
	 * @return the receiver
	 */
	public Receiver getReceiver() {
		return receiver;
	}

	/**
	 * @param receiver the receiver to set
	 */
	public void setReceiver(Receiver receiver) {
		this.receiver = receiver;
	}

	/**
	 * @return the pickup
	 */
	public Person getPickup() {
		return pickup;
	}

	/**
	 * @param pickup the pickup to set
	 */
	public void setPickup(Person pickup) {
		this.pickup = pickup;
	}

	/**
	 * @return the parcel
	 */
	public Parcel getParcel() {
		return parcel;
	}

	/**
	 * @param parcel the parcel to set
	 */
	public void setParcel(Parcel parcel) {
		this.parcel = parcel;
	}

	/**
	 * @return the returnParcel
	 */
	public ReturnParcel getReturnParcel() {
		return returnParcel;
	}

	/**
	 * @param returnParcel the returnParcel to set
	 */
	public void setReturnParcel(ReturnParcel returnParcel) {
		this.returnParcel = returnParcel;
	}

	/**
	 * @return the bizType
	 */
	public String getBizType() {
		return bizType;
	}

	/**
	 * @param bizType the bizType to set
	 */
	public void setBizType(String bizType) {
		this.bizType = bizType;
	}

	/**
	 * @return the routingTrial
	 */
	public Integer getRoutingTrial() {
		return routingTrial;
	}

	/**
	 * @param routingTrial the routingTrial to set
	 */
	public void setRoutingTrial(Integer routingTrial) {
		this.routingTrial = routingTrial;
	}

	/**
	 * @return the preCPResCode
	 */
	public String getPreCPResCode() {
		return preCPResCode;
	}

	/**
	 * @param preCPResCode the preCPResCode to set
	 */
	public void setPreCPResCode(String preCPResCode) {
		this.preCPResCode = preCPResCode;
	}

	/**
	 * @return the nextCPResCode
	 */
	public String getNextCPResCode() {
		return nextCPResCode;
	}

	/**
	 * @param nextCPResCode the nextCPResCode to set
	 */
	public void setNextCPResCode(String nextCPResCode) {
		this.nextCPResCode = nextCPResCode;
	}

	/**
	 * @return the pickupTime
	 */
	public String getPickupTime() {
		return pickupTime;
	}

	/**
	 * @param pickupTime the pickupTime to set
	 */
	public void setPickupTime(String pickupTime) {
		this.pickupTime = pickupTime;
	}

	/**
	 * @return the remark
	 */
	public String getRemark() {
		return remark;
	}

	/**
	 * @param remark the remark to set
	 */
	public void setRemark(String remark) {
		this.remark = remark;
	}

	/**
	 * @return the trackingNumber
	 */
	public String getTrackingNumber() {
		return trackingNumber;
	}

	/**
	 * @param trackingNumber the trackingNumber to set
	 */
	public void setTrackingNumber(String trackingNumber) {
		this.trackingNumber = trackingNumber;
	}

	/**
	 * @return the waybillUrl
	 */
	public String getWaybillUrl() {
		return waybillUrl;
	}

	/**
	 * @param waybillUrl the waybillUrl to set
	 */
	public void setWaybillUrl(String waybillUrl) {
		this.waybillUrl = waybillUrl;
	}

	/**
	 * @return the transportCode
	 */
	public String getTransportCode() {
		return transportCode;
	}

	/**
	 * @param transportCode the transportCode to set
	 */
	public void setTransportCode(String transportCode) {
		this.transportCode = transportCode;
	}

	/**
	 * @return the carrierCode
	 */
	public String getCarrierCode() {
		return carrierCode;
	}

	/**
	 * @param carrierCode the carrierCode to set
	 */
	public void setCarrierCode(String carrierCode) {
		this.carrierCode = carrierCode;
	}

	/**
	 * @return the buyer
	 */
	public ExtendedPerson getBuyer() {
		return buyer;
	}

	/**
	 * @param buyer the buyer to set
	 */
	public void setBuyer(ExtendedPerson buyer) {
		this.buyer = buyer;
	}

	/**
	 * @return the logisticsOrderCode
	 */
	public String getLogisticsOrderCode() {
		return logisticsOrderCode;
	}

	/**
	 * @param logisticsOrderCode the logisticsOrderCode to set
	 */
	public void setLogisticsOrderCode(String logisticsOrderCode) {
		this.logisticsOrderCode = logisticsOrderCode;
	}

	/**
	 * @return the trade
	 */
	public Trade getTrade() {
		return trade;
	}

	/**
	 * @param trade the trade to set
	 */
	public void setTrade(Trade trade) {
		this.trade = trade;
	}
}
